package com.qishanor.system.model.vo;

import com.qishanor.system.model.SysRole;
import com.qishanor.system.model.SysUser;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.nio.channels.Channel;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @description:
 * @author: 周振林
 * @date: 2022-04-22
 * 
 * @Copyright: 博客：http://www.zhouzhenlin.com - 沉淀、分享、成长、让自己和他人都有所收获
 **/

@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class SysUserVo extends SysUser {


    private List<SysRole> roleList;
    private List<Integer> roleIds;

    public List<Integer> getRoleIds() {
        return roleList.stream().map(u->u.getId()).collect(Collectors.toList());
    }

    public void setRoleIds(List<Integer> roleIds) {
        this.roleIds = roleIds;
    }
}
